]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Consume cancel key event
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 14 May 2024 23:55:40 +0000 (01:55 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 22 May 2024 14:32:41 +0000 (16:32 +0200)
The auth prompt currently propagates all key presses, even the
Escape press that is used to cancel it.

On the lock screen that means that the same event that cancels
the prompt (and switches back to the clock) is *also* propagated
to the handler that activates the prompt on key press.

That handler doesn't do anything when the prompt is already visible,
which is the case when the transition to the clock is animated.

However when animations are disabled, canceling the prompt will
result in a new prompt getting created immediately, and the login
screen is stuck on the prompt.

Fix this by not propagating key events that are used to cancel
the prompt.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3317>
(cherry picked from commit e7dc0de75ea3e44795ddca64267eff03992ce82f)

js/gdm/authPrompt.js

index ece597cc31e45761d70a21f49ada2a3ddb085879..8a46559d907ba29dbd78b5d5965158fccc8cf734 100644 (file)
@@ -134,8 +134,10 @@ export const AuthPrompt = GObject.registerClass({
     }
 
     on_key_press_event(event) {
-        if (event.get_key_symbol() === Clutter.KEY_Escape)
+        if (event.get_key_symbol() === Clutter.KEY_Escape) {
             this.cancel();
+            return Clutter.EVENT_STOP;
+        }
         return Clutter.EVENT_PROPAGATE;
     }